#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging

import config


class Logger(object):
    def __init__(self, clevel=logging.DEBUG, Flevel=logging.DEBUG):
        self.logger = logging.getLogger(config.APP_NAME)
        self.logger.setLevel(logging.DEBUG)
        handler = logging.StreamHandler()
        formatter = logging.Formatter(
            '%(asctime)s %(name)-12s %(levelname)-8s %(message)s')
        handler.setFormatter(formatter)
        self.logger.addHandler(handler)

    def debug(self, msg):
        self.logger.debug(msg)

    def info(self, msg):
        self.logger.info(msg)

    def error(self, msg):
        self.logger.error(msg)

    def warning(self, msg):
        self.logger.warn(msg)


logger = Logger()
